﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// BienLaiTra Repository. Good example of CRUD operations.
    ///// </summary>
    public class BienLaiTraRepository : IBienLaiTraRepository
    {
        private static readonly IBienLaiTraDao _bienLaiTra = DataAccess.BienLaiTraDao;
        public List<BienLaiTra> GetList()
        {
            return _bienLaiTra.GetBienLaiTra().ToList();
        }

        public BienLaiTra Get(string id)
        {
            return _bienLaiTra.GetBienLaiTraByID(id);
        }

        public void Insert(BienLaiTra t)
        {
            _bienLaiTra.InsertBienLaiTra(t);
        }

        public void Update(BienLaiTra t)
        {
            _bienLaiTra.UpdateBienLaiTra(t);
        }

        public void Delete(BienLaiTra t)
        {
            _bienLaiTra.DeleteBienLaiTra(t);
        }

        public List<BienLaiTra> GetBienLaiTraByClassIdAndSchoolSchoolYear(string schoolYearID, int schoolId, string classId) 
        {
            return _bienLaiTra.GetBienLaiTraByClassIdAndSchoolSchoolYear(schoolYearID, schoolId, classId);
        }


        public int InsertGetId(BienLaiTra obj)
        {
            return _bienLaiTra.InsertGetId(obj);
        }
    }
}